/*// item selection
$('.file-box').click(function () {
  $(this).toggleClass('selected');
  if ($('.file-box.selected').length == 0)
    $('.select').removeClass('selected');
  else
    $('.select').addClass('selected');
  counter();
});

// all item selection
$('.select').click(function () {
  if ($('.file-box.selected').length == 0) {
    $('.file-box').addClass('selected');
    $('.select').addClass('selected');
  }
  else { 
    $('.file-box').removeClass('selected');
    $('.select').removeClass('selected');
  }
  counter();
});

// number of selected items
function counter() {
  if ($('.file-box.selected').length > 0)
    $('.send').addClass('selected');
  else
    $('.send').removeClass('selected');
  $('.send').attr('data-counter',$('li.selected').length);
}


var rem=new Array(); 
function shift_select(){  
   
    $(".file-box").click(function (e){  
        
        if(e.shiftKey){  
            rem.push($(".file-box").index($(this)));
            var upOne = rem[rem.length-2];
            var clazzVal = $(this).attr("class");
            var iMin =  Math.min(rem[rem.length-2],rem[rem.length-1])  
            var iMax =  Math.max(rem[rem.length-2],rem[rem.length-1])  
            for(i=iMin;i<=iMax;i++){  
                $(".file-box:eq("+i+") ").addClass("selected") ;  
                //这边部分为逻辑代码，你可以根据需要来处理全中的div  
               //$(".box div:eq("+i+")")这为选中的div  
            }  
        }else{  
            //$(this).toggleClass("selected");  
        }  
    });  
}  
$(function(){  
    shift_select();  
});  
document.onselectstrat=function(event){   //避免文字被选中  
    event = window.event||event;  
    event.returnValue = false;  
}*/


      function toFileManagerAll(pageNum , selectid , pageSizeStr){
    	  
    	  	//var pageSizeStr = $("#file-page-size").val();
	    	var pageNumber = "{pageNum:'"+pageNum+"',pageSizeStr:'"+pageSizeStr+"'}";
	    	var data = doPost("toFileManager", pageNumber);
	    	var fileList = data.detail.list;
	    	if(fileList.length>0){
	    		var htmlAll = "";
	    		for(var i = 0 ; i < fileList.length ; i++ ){
	    			var fileObj = fileList[i];
	    			htmlAll += "<div class='file-box img-box '><div class='file'><a name='><span class='corner'></span><div class='image'><img alt='image' class='img-responsive' src='../../../../upload/"+fileObj.upload_path+"/"+fileObj.file_name +"'></div><div class='file-name'>"+fileObj.file_name +"<br/><small>添加时间："+fileObj.upload_time +"</small></div></a></div></div>";
	    		}
	    		//console.log(htmlAll);
	    		$("#file-list").empty();
	        	$("#file-list").append(htmlAll);
	    	}
	    	
	    	var totalPage = data.detail.totalPage
	    	
	    	if(totalPage){
	    		
	    	}
	   		var option = "";
	    	for(var i = 1 ; i <= parseInt(totalPage) ; i ++){
	    		option += "<option value='"+i+"'>第"+i+"页</option>";
	    	}
	    	$("#"+selectid).empty();
	    	$("#"+selectid).append(option);
	    }
        function toFileManagerFile(pageNum , pageSizeStr){
        	
        	//var pageSizeStr = $("#file-page-size").val();
	    	var pageNumber = "{pageNum:'"+pageNum+"',pageSizeStr:'"+pageSizeStr+"'}";
        	var data = doPost("toFileManager", pageNumber);
        	var fileList = data.detail.list;
        	if(fileList.length>0){
        		var htmlAll = "";
        		for(var i = 0 ; i < fileList.length ; i++ ){
        			var fileObj = fileList[i];
        			htmlAll += "<div class='file-box img-box '><div class='file'><a name='><span class='corner'></span><div class='image'><img alt='image' class='img-responsive' src='../../../../upload/"+fileObj.upload_path+"/"+fileObj.file_name +"'></div><div class='file-name'>"+fileObj.file_name +"<br/><small>添加时间："+fileObj.upload_time +"</small></div></a></div></div>";
        		}
        		//console.log(htmlAll);
        		$("#file-list").empty();
            	$("#file-list").append(htmlAll);
        	}
        	
        	var totalPage = data.detail.totalPage
        	var pageDiv = "<div>";

        }   
        
       	function select_img(){
       		$('.file-box').click(function () {
	      		$(this).toggleClass('selected');
	      	 	if ($('.file-box.selected').length == 0){
	      	    	$('.select').removeClass('selected');
	      	 	} else{
	      	    	$('.select').addClass('selected');
	      	 	}
       		})
       		if ($('.file-box.selected').length > 0){
           	   $('.send').addClass('selected');
       		}else{
           	  $('.send').removeClass('selected');
           	  $('.send').attr('data-counter',$('li.selected').length);
       	  	}
       		
       		shift_select();
       	}
       	
       	var rem=new Array(); 
       	function shift_select(){  
       	    $(".file-box").click(function (e){  
       	        
       	        if(e.shiftKey){  
       	            rem.push($(".file-box").index($(this)));
       	            var upOne = rem[rem.length-2];
       	            var clazzVal = $(this).attr("class");
       	            var iMin =  Math.min(rem[rem.length-2],rem[rem.length-1])  
       	            var iMax =  Math.max(rem[rem.length-2],rem[rem.length-1])  
       	            for(i=iMin;i<=iMax;i++){  
       	                $(".file-box:eq("+i+") ").addClass("selected") ;  
       	                //这边部分为逻辑代码，你可以根据需要来处理全中的div  
       	               //$(".box div:eq("+i+")")这为选中的div  
       	            }  
       	        }else{  
       	            //$(this).toggleClass("selected");  
       	        }  
       	    });  
       	} 


























